"MOD 2"
By Dan Sandin
1980


"MOD 2," a Bally BASIC video art program, that appeared in an article called 
"Pix-Art" by Frank Dietrich and Zsuzsanna Molnar.  This article, which appeared 
in "Computer Graphics and Art," 1980-1981 Yearbook 5, covers the Bally Arcade 
as a low-cost solution to create graphics using Bally BASIC and the ZGrass 
language.  It specifically talks about several pieces of art that were written 
using the two languages.  Some of the video art pictures are included in the 
article, as well as some source code for a few programs.

"MOD 2" was retyped from a version of the article from the Bob Fabris 
collection.  The article in that collection isn't a photocopy of the "Computer 
Graphics and Art" article.  Given Bob's ties to the Bally Arcade community 
through his Arcadian newsletter, perhaps this is the version of the article 
that was submitted to the magazine and eventually printed.

A similar article to "Pix-Art" was published in "Creative Computing" (June 
1981) as "Pictures by Funny Numbers."  Credit in the article is given to "Frank 
Dietrich and Zsuzsa Molnar."  I'm not sure which are the correct spellings of 
the names.

The "MOD 2" program, while written in Bally BASIC, was not given line numbers.  
On September 27, 2018, this program was typed into "AstroBASIC" by Adam 
Trionfo.  The program was digitally archived used BallyBin and AstroWAV 1.4.

Here are the program and its accompanying notes, as they appeared in the "Pix-
Art" article:

------------------------------

Dan Sandin needs about 15 minutes to finish a single one of these MOD images, 
consisting of circles which seem to be mapped onto globes.

     MOD 2

     CLEAR
     D=5
     FOR Y=43 to -44 STEP -1 D=D+2
          FOR X= -80 to 79
               M= (X*X+Y*Y) /D /2
               IF RM = 0 BOX X,Y,1,1,1
          NEXT X
     NEXT Y
     STOP

Some of the important aspects of this compact 10 line program are:

1. Only two nested loops create the basic structure which scans the whole 
screen.

2. The computation of X and Y squared for each pixel and the RM command which 
returns the remainder of a division, makes it possible to generate circles even 
in an integer basic.

3. The size of the circles depends on the value of the division factor-- D.  
Their growth is controlled by incrementing D after one vertical line is 
scanned, thus also generating the 3-D effect.  Without incrementing D the 
result would be a regular pattern of circles of the same size.

------------------------------

This is the program as it was typed into "AstroBASIC:"

5 .MOD 2
10 CLEAR 
20 D=5
30 FOR Y=43TO -44STEP -1
40 D=D+1
50 FOR X=-80TO 79
60 M=(XX+YY)D2
70 IF RM=0BOX X,Y,1,1,1
80 NEXT X
90 NEXT Y
100 STOP


